Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Substitute SyncBN with BN for mmpose #1631

Merged

Conversation

hanrui1sensetime
Copy link
Collaborator

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

All other codebases can substitute SyncBN with BN in build_pytorch_model function from the BaseTask class, while mmpose overwrites the build_pytorch_model function without substitute SyncBN with BN. It will failed on RTMPose deployment.

Modification

Call the mmengine API revert_sync_batchnorm in mmpose build_pytorch_model function.

BC-breaking (Optional)

None.

Use cases (Optional)

RTMPose deployment.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci failed, could fix it before merge?

@RunningLeon RunningLeon self-requested a review January 10, 2023 10:01
@lvhan028
Copy link
Collaborator

Why cannot reuse BaseTask's build_pytorch_model?
Doesn't mmpose support mmengine.registry.MODELS.build(model)?

@RunningLeon RunningLeon requested a review from grimoire January 12, 2023 01:00
Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls check this change with regression test

Merge branch 'temp' into fix_syncbn_for_mmpose_dev-1.x
@lvhan028 lvhan028 merged commit ef260d8 into open-mmlab:dev-1.x Jan 16, 2023
lvhan028 pushed a commit that referenced this pull request Mar 1, 2023
* fix syncbn for mmpose

* unify build_pytorch_model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants